Conversation
- FIX 1: Iterate over a copy of the list to avoid ConcurrentModificationException. - FIX 2: Only reply once per request to avoid "Reply already submitted" crash.
- FIX 1: Iterate over a copy of the list to avoid ConcurrentModificationException. - FIX 2: Only reply once per request to avoid "Reply already submitted" crash.
ymkil
added a commit
to ymkil/flutter_tts
that referenced
this pull request
Aug 6, 2025
Contributor
Author
|
@dlutton please review, i tested in production and it's working great |
Owner
|
@hsangtini , does the PR in #594 also solve your issue? I need to determine which solution fits best here. |
Contributor
Author
|
I don’t know about that PR, but with my PR it’s working well in production. All crashes are gone. |
|
Please merge this request to fix the crash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exception java.util.ConcurrentModificationException:
at java.util.ArrayList$Itr.checkForComodification (ArrayList.java:1111)
at java.util.ArrayList$Itr.next (ArrayList.java:1064)
at com.tundralabs.fluttertts.FlutterTtsPlugin.onInitListener$lambda$3 (FlutterTtsPlugin.java:221)
at android.speech.tts.TextToSpeech.lambda$dispatchOnInit$0 (TextToSpeech.java:934)
at android.speech.tts.TextToSpeech.$r8$lambda$goj8UKjdOAM21kdYLRXRNDpSxxI (Unknown Source)
at android.speech.tts.TextToSpeech$$ExternalSyntheticLambda1.run (Unknown Source:4)
at android.speech.tts.TextToSpeech.dispatchOnInit (TextToSpeech.java:943)
at android.speech.tts.TextToSpeech.-$$Nest$mdispatchOnInit (Unknown Source)
at android.speech.tts.TextToSpeech$Connection$SetupConnectionAsyncTask.onPostExecute (TextToSpeech.java:2324)
at android.speech.tts.TextToSpeech$Connection$SetupConnectionAsyncTask.onPostExecute (TextToSpeech.java:2284)
at android.os.AsyncTask.finish (AsyncTask.java:771)
at android.os.AsyncTask.-$$Nest$mfinish (Unknown Source)
at android.os.AsyncTask$InternalHandler.handleMessage (AsyncTask.java:788)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loopOnce (Looper.java:230)
at android.os.Looper.loop (Looper.java:319)
at android.app.ActivityThread.main (ActivityThread.java:8919)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)
Exception java.lang.IllegalStateException: Reply already submitted
at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply (DartMessenger.java:431)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success (MethodChannel.java:272)
at com.tundralabs.fluttertts.FlutterTtsPlugin.onInitListener$lambda$3 (FlutterTtsPlugin.java:240)
at android.speech.tts.TextToSpeech.lambda$dispatchOnInit$0 (TextToSpeech.java:934)
at android.speech.tts.TextToSpeech.$r8$lambda$goj8UKjdOAM21kdYLRXRNDpSxxI (Unknown Source)
at android.speech.tts.TextToSpeech$$ExternalSyntheticLambda1.run (Unknown Source:4)
at android.speech.tts.TextToSpeech.dispatchOnInit (TextToSpeech.java:943)
at android.speech.tts.TextToSpeech.-$$Nest$mdispatchOnInit (Unknown Source)
at android.speech.tts.TextToSpeech$Connection$SetupConnectionAsyncTask.onPostExecute (TextToSpeech.java:2324)
at android.speech.tts.TextToSpeech$Connection$SetupConnectionAsyncTask.onPostExecute (TextToSpeech.java:2284)
at android.os.AsyncTask.finish (AsyncTask.java:771)
at android.os.AsyncTask.-$$Nest$mfinish (Unknown Source)
at android.os.AsyncTask$InternalHandler.handleMessage (AsyncTask.java:788)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loopOnce (Looper.java:230)
at android.os.Looper.loop (Looper.java:319)
at android.app.ActivityThread.main (ActivityThread.java:8919)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)